function _spliceStr(str, length, key) {
    if (!str) {
        return {};
    }
    let strLen = str.length;
    let n = strLen / length + 1;
    let i = 0;
    let result = {};
    while (i < n) {
        let tmp = str.slice(i * length, (i + 1) * length);
        i++;
        result[key + i] = tmp;
    }
    return result;
}


let m = [{
    key: 'receiverAddress',
    rule: [20, 30]
}, {
    key: 'senderAddress',
    rule: [25, 22]
}, {
    key: 'remark',
    rule: [21]
}];
let t = {
    receiverAddress: "1234567890helloworldtostring"
};

m.map(item => {
    let {
        key,
        rule
    } = item;
    rule.map((len, idx) => {
        console.log(key + (idx + 1));
        t = Object.assign({}, t, _spliceStr(t[key], len, key + (idx + 1)));
    });
})

console.log("helloworld".substr(-3));
//console.log(t);

let tempStr='{a},{b},{c}';
tempStr.replace(/{(\S*)}/g, (all, key) => {
    console.log( all+"||"+key+",");
})


let code='D2D1';
console.log(parseInt(code.slice(0, 2), 16));

